package com.kfm.spring.controller;

import com.kfm.spring.domain.Account;
import com.kfm.spring.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private AccountService service;

    @RequestMapping("/hello")
    public String hello(){
        return "Hello World!";
    }


    @RequestMapping("/account")
    public Account getAccounts(Integer id){
        return service.findById(id);
    }


}
